package com.namo.ccharticle.dao;

import com.namo.ccharticle.entity.Type;
import org.apache.ibatis.annotations.Mapper;import java.util.List;

/**
 * @author WangXin
 * @date 2021/5/19 13:16
 */

@Mapper
public interface TypeMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(String id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(Type record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(Type record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    Type selectByPrimaryKey(String id);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Type record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Type record);

    /**
     * 查询所有类型
     *
     * @return
     */
    List<Type> selectAll();

    /**
     * 通过名字寻找
     * @param name
     * @return
     */
    Type selectByName(String name);

}